package kr.hkit.powerjava.chapter11.work;

public class Food {
	
	int cal;
	int cost;
	int weight;
	public Food(int cal, int cost, int weight) {
		super();
		this.cal = cal;
		this.cost = cost;
		this.weight = weight;
	}
	public int getCal() {
		return cal;
	}
	public void setCal(int cal) {
		this.cal = cal;
	}
	public int getCost() {
		return cost;
	}
	public void setCost(int cost) {
		this.cost = cost;
	}
	public int getWeight() {
		return weight;
	}
	public void setWeight(int weight) {
		this.weight = weight;
	}
	

}
class Melon extends Food{
	String gnj;

	public Melon(int cal, int cost, int weight, String gnj) {
		super(cal, cost, weight);
		this.gnj = gnj;
	}

	public String getGnj() {
		return gnj;
	}

	public void setGnj(String gnj) {
		this.gnj = gnj;
	}

	@Override
	public String toString() {
		return String.format("Melon [경작 농원 정보 : %s, 칼로리 : %sKcal, 가격 : %s원, 중량 : %sg]", gnj,
				cal, cost, weight);
	}
	
	
}
